<?php
    session_start();
?>
<div id="header">
<a href="#" class="logo">
<h1>JOB STOCK ADMINISTRATION</h1>

</a>
<div style="float: right;">
Xin chào: 
<?php
    if(isset($_SESSION["loginuser"])){
        $loggedInUser = $_SESSION['loginuser'];
        echo "<a href='../pc/personalInformation.php'>";
        echo $loggedInUser[1];
        echo "</a>";
        echo "&nbsp; <a href='../action/logout.php'>Logout</a>";
    }else{
        echo "<script>window.location.href='login.php'</script>";
    }
?>
</div>
    <ul id="top-navigation">
        <?php
        //Admin function
        if($loggedInUser[2] == 1){
            //trang quan li user
            if($page == 1){
                echo "<li class='active'><span><span>Quản lí thông tin cho admin</span></span></li>";
            }else{
                echo "<li><span><span><a href='../admin/administration.php'>Quản lí thông tin cho admin</a></span></span></li>";
            }
        }
        ?>
        <?php
        //Mod funtion
        if($loggedInUser[2] == 2){
            if($page == 2){
                echo "<li class='active'><span><span>Quản lí thông tin cho mod</span></span></li>";
            }else{
                echo "<li><span><span><a href='../admin/mod.php'>Quản lí thông tin cho mod</a></span></span></li>";
            }
        }
        ?>
        <?php
        //Company function
        if($loggedInUser[2] == 3){
            if($page == 3){
                echo "<li class='active'><span><span>Đăng tin tuyển dụng</span></span></li>";
            }else{
                echo "<li><span><span><a href='../pc/recruitments.php'>Đăng tin tuyển dụng</a></span></span></li>";
            }
        }
        ?>
        <?php
        //User function
        if($loggedInUser[2] == 4){
            if($page == 4){
                echo "<li class='active'><span><span>Tìm kiếm tin tuyển dụng</span></span></li>";
            }else{
                echo "<li><span><span><a href='../pc/searchRecruitments.php'>Tìm kiếm tin tuyển dụng</a></span></span></li>";
            }
        }
        ?> 
    </ul>
</div>